﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace MVC.Models {
  public static class ModelBuilderExtensions {
    public static void Seed(this ModelBuilder modelBuilder) {
      modelBuilder.Entity<Student>().HasData(
        new Student() { Id = 1, Name = "张三", ClassName = ClassNameEnum.FirstGrade, Email = "zhang@qq.com" },
        new Student() { Id = 2, Name = "李四", ClassName = ClassNameEnum.SencondGrade, Email = "li@qq.com" },
        new Student() { Id = 3, Name = "王五", ClassName = ClassNameEnum.ThirdGrade, Email = "wang@qq.com" }
      );
    }

  }
}
